package com.xneure.enging;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Scope;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
import com.xneure.code.log.ILog;
import com.xneure.code.log.LogManage;

//@Configuration  
//@EnableWebMvc
//@ComponentScan(basePackages = "com.xneure.*", useDefaultFilters = false, includeFilters = {  
//        @ComponentScan.Filter(type = FilterType.ANNOTATION, value = {Controller.class})  
//})  
public class SpringConfig extends WebMvcConfigurationSupport {
	@Bean(name = "log")
	public ILog log() {
		return LogManage.newLog();
	}
	@Bean(name = "sLog")
	@Scope("session")
	public ILog logSession() {
		return LogManage.newLog();
	}
    /**                                                           
    * 描述 : <添加拦截器>. <br>  
    *<p>  
        <使用方法说明>   
     </p>                                                                                                                                                                                                                                                 
    * @param registry                                                                                                       
    */    
    @Override  
    protected void addInterceptors(InterceptorRegistry registry) {  
        registry.addInterceptor(new RequestInterceptor());  
    } 
    
}
